<?
session_start();

require("..\..\misc.php");
require("..\..\classCol\classOracleDb.php");
require("..\..\helpers\CHtml.php");
require("..\..\helpers\CJavascript.php");

require("../models/fetchers.php");

$align = " align='center' ";

$CHtml = new CGHtml;
$CJs   = new CGJavascript;

$propSubmit = $CJs->jsOnClick("window.close();");

if($_GET["prevEntry"]){
  
  $srcDbManInHdr = "PCH_RET_MANUAL_SER_NUMBER_HDR";
  $srcDbManInDtl = "PCH_RET_MANUAL_SER_NUMBER_DTL";
  
  
  $COracle = new oracleDb;
  
  $COracle->init($_SESSION["ORCL"], 
                 $_SESSION["OPASS"],
                 $_SESSION["SID"],
                 _NO_COMMENT);
    
  if($COracle->connect()){
  
    fetchManEntDetail($COracle,
                      $_GET["prevEntry"],
                      $srcDbManInDtl,
                      $manInData);
  }else{
    
    $jsError = "alert(\"Error: oracle connection failed and so initialisation\");";
    
    echo $CJs->jsScript(NULL,
                        $jsError);
  }
  
  $COracle->dc();
}else{
  
  $manInData = "";
}
?>

<html>

<script LANGUAGE="javascript" SRC="/ecs/tocmenu_44/javascript/misc.js"></script>
<script LANGUAGE="javascript" SRC="/ecs/tocmenu_44/javascript/ajax.js"></script>

<script LANGUAGE="javascript">
  
</script>

<title> MiniView </title>

<body>
    
  <textarea name='miniViewEnt' 
            style='height:200; width:200'><?=$manInData ?></textarea>
  
  <?=$CHtml->formSubmit("submit",
                        "close",
                        $propSubmit.
                        $align) ?>

</body>
</html>